package com.ruoyi.teaching.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teaching.mapper.TeachingClassificationMapper;
import com.ruoyi.teaching.domain.TeachingClassification;
import com.ruoyi.teaching.service.ITeachingClassificationService;

/**
 * 分类信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-21
 */
@Service
public class TeachingClassificationServiceImpl implements ITeachingClassificationService 
{
    @Autowired
    private TeachingClassificationMapper teachingClassificationMapper;

    /**
     * 查询分类信息
     * 
     * @param classificationId 分类信息主键
     * @return 分类信息
     */
    @Override
    public TeachingClassification selectTeachingClassificationByClassificationId(Long classificationId)
    {
        return teachingClassificationMapper.selectTeachingClassificationByClassificationId(classificationId);
    }

    /**
     * 查询分类信息列表
     * 
     * @param teachingClassification 分类信息
     * @return 分类信息
     */
    @Override
    public List<TeachingClassification> selectTeachingClassificationList(TeachingClassification teachingClassification)
    {
        return teachingClassificationMapper.selectTeachingClassificationList(teachingClassification);
    }

    /**
     * 新增分类信息
     * 
     * @param teachingClassification 分类信息
     * @return 结果
     */
    @Override
    public int insertTeachingClassification(TeachingClassification teachingClassification)
    {
        teachingClassification.setCreateTime(DateUtils.getNowDate());
        return teachingClassificationMapper.insertTeachingClassification(teachingClassification);
    }

    /**
     * 修改分类信息
     * 
     * @param teachingClassification 分类信息
     * @return 结果
     */
    @Override
    public int updateTeachingClassification(TeachingClassification teachingClassification)
    {
        teachingClassification.setUpdateTime(DateUtils.getNowDate());
        return teachingClassificationMapper.updateTeachingClassification(teachingClassification);
    }

    /**
     * 批量删除分类信息
     * 
     * @param classificationIds 需要删除的分类信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingClassificationByClassificationIds(Long[] classificationIds)
    {
        return teachingClassificationMapper.deleteTeachingClassificationByClassificationIds(classificationIds);
    }

    /**
     * 删除分类信息信息
     * 
     * @param classificationId 分类信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingClassificationByClassificationId(Long classificationId)
    {
        return teachingClassificationMapper.deleteTeachingClassificationByClassificationId(classificationId);
    }
}
